version 15
set more off  
clear
capture log close
macro drop _all 

*********************************************************************     				
*	GRAPHS FOR "The Militarization of Law Enforcement: 				*
* 	Evidence from Latin America"    	   		       				*
*********************************************************************

gl data "Working Directory"
gl fig "Working Directory"
gl log "Working Directory"

log using "$log/logofFig4and5.log", replace


use "$data/Sinaloa_Homicides", clear

keep if muncode=="25009" | muncode=="25010"
drop if year==2018

twoway (line thom year if muncode=="25010") ///
	(line thom year if muncode=="25009"), ///
	legend(label(1 "El Fuerte, SIN") label(2 "Escuinapa, SIN") r(1) position(6)) ///
	ylabel(0(30)150) xlabel(2000(1)2017, labsize(vsmall)) ///
	ytitle("Rate per 100,000 people") xtitle(Year) ///
	xline(2008, lcolor(black) lpattern(solid))
	
	graph export "$fig/Fig4.tif", replace
	
use "$data/Sinaloa_HR", clear	

twoway (line sedenarate year) ///
	(line polfedrate year), ///
	legend(label(1 "Military(SEDENA)") label(2 "Federal Police") r(1) position(6)) ///
	ylabel(0(10)50) xlabel(2008(1)2017, labsize(small)) ///
	ytitle("Rate per 1,000 personnel") xtitle(Year)
	
	graph export "$fig/Fig5.tif", replace
	
log close
